<template>
  <el-form-item class="edit-item edit-item-switch switch-normal" :label="label">
    <el-switch
      v-model="modelValue"
      active-color="#127BFF"
      inactive-color="#D5DCE6" @change="onChange">
    </el-switch>
  </el-form-item>
</template>

<script setup lang="ts">
import TooltipCommon from './tooltip-common.vue'

interface Props {
  modelValue: boolean,
  label: string | number,
}
const props = withDefaults(defineProps<Props>(), {
  modelValue: false
})

const emit = defineEmits(['change','update:modelValue'])
const onChange = (val: string) => {
  emit('update:modelValue', val)
  emit('change', val)
}
</script>
